﻿using DataTransfer.SDK;
using DataTransfer.SDK.Models;
using MiniFox.Components;
using MiniFox.Platform.Applications.Auth;

namespace DataTransfer.Core.Services
{
    /// <summary>
    /// 数据加载器
    /// </summary>
    [AutoRegister, SpareComponent(typeof(DefaultDataLoader))]
    public abstract class DataLoader : Component
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="exporter"></param>
        /// <param name="authStateManagement"></param>
        protected DataLoader(IExporter exporter, IAuthStateManagement authStateManagement)
        {
            Exporter = exporter;
            AuthStateManagement = authStateManagement;
            Name = exporter.Name;
        }

        protected IExporter Exporter { get; }

        protected IAuthStateManagement AuthStateManagement { get; }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="queryContent"></param>
        /// <returns></returns>
        public abstract object ExecuteLoad(object queryContent);

    }

}
